<h2>注册</h2>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
  <%= render "devise/shared/error_messages", resource: resource %>

  <div class="field">
    <%= f.label "邮箱" %><br />
    <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
  </div>

  <div class="field">
    <%= f.label "密码" %>
    <% if @minimum_password_length %>
    <em>(最少<%= @minimum_password_length %>位)</em>
    <% end %><br />
    <%= f.password_field :password, autocomplete: "new-password" %>
  </div>

  <div class="field">
    <%= f.label "确认密码" %><br />
    <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
  </div>

    <div class="field">
    <%= f.label "昵称" %><br />
    <%= f.text_field :username, autofocus: true %>
  </div>

  <div class="field">
    <%= f.label "联系方式" %><br />
    <%= f.text_field :contact %>
  </div>

  <div class="field">
    <%= f.label "区域" %><br />
    <%= f.select :region, ["玉泉路", "中关村", "奥运村", "雁栖湖"] %>
  </div>

  <div class="field">
    <%= f.label "备注" %><br />
    <%= f.text_area :note %>
  </div>

  <div class="actions">
    <%= f.submit "注册" %>
  </div>
<% end %>

<%= render "devise/shared/links" %>
